<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>失去焦点事件</title>
    <!--
    引入jQuery的js文件
    -->
    <script type="text/javascript" src="jquery-1.8.3.js"></script>
    <script type="text/javascript">
        //页面加载事件
        $(function () {
            //用户名失去焦点后获取输入的值
            $("#username").blur(function () {
                alert($("#username").val());
            });
        });
    </script>
</head>
<body>
    <form>
        用户名：<input type="text" id="username" name="username"><br/>
        密码：<input type="password" id="password" name="password"><br>
        <input  type="submit" id="submit"><br/>
    </form>

</body>
</html>